import cgi
import wsgiref.handlers

from google.appengine.ext import webapp
from google.appengine.api import urlfetch


class Rework(webapp.RequestHandler):
  def get(self):
    url = self.request.query_string
    result = urlfetch.fetch(url)
    self.response.headers['Content-Type'] = 'application/xml'
    self.response.out.write(result.content.lstrip("\r\n"))


def main():
  application = webapp.WSGIApplication(
                                       [('/reworkfeed', Rework)],
                                       debug=False)
  wsgiref.handlers.CGIHandler().run(application)
if __name__ == "__main__":
  main()
